package com.jiedeng.dao;

import com.jiedeng.model.ProjectPerson;
import com.jiedeng.model.Spec;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author 覃远龙
 * @ClassName: ISpecRepository
 * @Description:
 * @date 2017/4/25 13:27
 */
public interface ISpecRepository extends JpaRepository<Spec, Integer> {

    @Query(nativeQuery = true, value =  " SELECT DISTINCT ts.* FROM t_spec ts LEFT JOIN t_period tp on ts.Spec_ID=tp.Spec_ID where tp.prop_ID = ?1 ORDER BY ts.Spec_ID ")
    List<Spec> findSpecGetPropId(Integer propId);
}
